home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 08 - 1992 / 08.02 Jun 92 / Modifying Print Dialogs / NoDraft.r < prev   
Encoding:
Text File  |  1991-08-08  |  4.9 KB  |  278 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------
  2. #    Simple NoDraft Printing Application
  3. #
  4. #    NoDraft
  5. #
  6. #    NoDraft.r    -    Rez Source
  7. #
  8. #    Copyright © 1991 Greg Wilson.
  9. #    Copyright © 1991 MacTutor.
  10. #    All rights reserved.
  11. #
  12. -------------------------------------*/
  13.  
  14. #include "Types.r"
  15.  
  16. #include "NoDraft.h"
  17.  
  18.  
  19. /* we use an MBAR resource to  load all menus */
  20.  
  21. resource 'MBAR' (rMenuBar, preload) {
  22.     { mApple, mFile, mEdit };    /* four menus */
  23. };
  24.  
  25. resource 'MENU' (mApple, preload) {
  26.     mApple, textMenuProc,
  27.     AllItems & ~MenuItem2,
  28.     /* Disable dashed line, enable About and DAs */
  29.     enabled, apple,
  30.     {
  31.         "About NoDraft…",
  32.             noicon, nokey, nomark, plain;
  33.         "-",
  34.             noicon, nokey, nomark, plain
  35.     }
  36. };
  37.  
  38. resource 'MENU' (mFile, preload) {
  39.     mFile, textMenuProc,
  40.     MenuItem12,    /* enable Quit, program does rest */
  41.     enabled, "File",
  42.     {
  43.         "New",
  44.             noicon, "N", nomark, plain;
  45.         "Open",
  46.             noicon, "O", nomark, plain;
  47.         "-",
  48.             noicon, nokey, nomark, plain;
  49.         "Close",
  50.             noicon, "W", nomark, plain;
  51.         "Save",
  52.             noicon, "S", nomark, plain;
  53.         "Save As…",
  54.             noicon, nokey, nomark, plain;
  55.         "Revert",
  56.             noicon, nokey, nomark, plain;
  57.         "-",
  58.             noicon, nokey, nomark, plain;
  59.         "Page Setup…",
  60.             noicon, nokey, nomark, plain;
  61.         "Print…",
  62.             noicon, nokey, nomark, plain;
  63.         "-",
  64.             noicon, nokey, nomark, plain;
  65.         "Quit",
  66.             noicon, "Q", nomark, plain
  67.     }
  68. };
  69.  
  70. resource 'MENU' (mEdit, preload) {
  71.     mEdit, textMenuProc,
  72.     NoItems,                /* disable all, program does it */
  73.     enabled, "Edit",
  74.      {
  75.         "Undo",
  76.             noicon, "Z", nomark, plain;
  77.         "-",
  78.             noicon, nokey, nomark, plain;
  79.         "Cut",
  80.             noicon, "X", nomark, plain;
  81.         "Copy",
  82.             noicon, "C", nomark, plain;
  83.         "Paste",
  84.             noicon, "V", nomark, plain;
  85.         "Clear",
  86.             noicon, nokey, nomark, plain
  87.     }
  88. };
  89.  
  90. /* this ALRT and DITL are used as About screen */
  91.  
  92. resource 'ALRT' (rAboutAlert, purgeable) {
  93.     {40, 20, 170, 372},
  94.     rAboutAlert,
  95.     {    /* array: 4 elements */
  96.         /* [1] */
  97.         OK, visible, silent,
  98.         /* [2] */
  99.         OK, visible, silent,
  100.         /* [3] */
  101.         OK, visible, silent,
  102.         /* [4] */
  103.         OK, visible, silent
  104.     }
  105. };
  106.  
  107. resource 'DITL' (rAboutAlert, purgeable) {
  108.     {    /* array DITLarray: 5 elements */
  109.         /* [1] */
  110.         {98, 252, 118, 332},
  111.         Button {
  112.             enabled,
  113.             "OK"
  114.         },
  115.         /* [2] */
  116.         {6, 13, 71, 329},
  117.         StaticText {
  118.             disabled,
  119.             "Simple Program which modifies Print Dial"
  120.             "ogs to disable the Draft mode Radio Butt"
  121.             "on and add a Filter Proc Function."
  122.         },
  123.     /* [3] */
  124.         {101, 14, 117, 243},
  125.         StaticText {
  126.             disabled,
  127.             "Copyright © 1991 MacTutor"
  128.         },
  129.         /* [4] */
  130.         {75, 13, 91, 141},
  131.         StaticText {
  132.             disabled,
  133.             "Written by:"
  134.         },
  135.         /* [5] */
  136.         {74, 155, 94, 259},
  137.         StaticText {
  138.             disabled,
  139.             "Greg Wilson"
  140.         }
  141.     }
  142. };
  143.  
  144. /* this ALRT and DITL are used as error screen */
  145.  
  146. resource 'ALRT' (rUserAlert, purgeable) {
  147.     {40, 20, 120, 260},
  148.     rUserAlert,
  149.     { /* array: 4 elements */
  150.         /* [1] */
  151.         OK, visible, silent,
  152.         /* [2] */
  153.         OK, visible, silent,
  154.         /* [3] */
  155.         OK, visible, silent,
  156.         /* [4] */
  157.         OK, visible, silent
  158.     }
  159. };
  160.  
  161. resource 'DITL' (rUserAlert, purgeable) {
  162.     { /* array DITLarray: 3 elements */
  163.         /* [1] */
  164.         {50, 150, 70, 230},
  165.         Button {
  166.             enabled,
  167.             "OK"
  168.         },
  169.         /* [2] */
  170.         {10, 60, 30, 230},
  171.         StaticText {
  172.             disabled,
  173.             "NoDraft - Error occurred!"
  174.         },
  175.         /* [3] */
  176.         {8, 8, 40, 40},
  177.         Icon {
  178.             disabled,
  179.             2
  180.         }
  181.     }
  182. };
  183.  
  184. resource 'WIND' (rWindow, "A Window") {
  185.     {42, 2, 330, 508},
  186.     DocumentProc, invisible, GoAway, 0x0, "A Window"
  187. };
  188.  
  189. resource 'DLOG' (130, purgeable) {
  190.     {48, 24, 368, 532},
  191.     dBoxProc,
  192.     invisible,
  193.     noGoAway,
  194.     0x0,
  195.     130,
  196.     ""
  197. };
  198.  
  199. resource 'STR#' (kErrStrings, purgeable) {
  200.     {
  201.     "An error has occurred";
  202.     "Application Memory Size is too small";
  203.     "Not enough memory to run NoDraft";
  204.     "Cannot create window";
  205.     }
  206. };
  207.  
  208. type 'PSMP' as 'STR ';
  209.  
  210. resource 'PSMP' (0) {
  211.     "Simple Demo of Modifying Printing Dialogs - Version ß 1.0"
  212. };
  213.  
  214. resource 'ICN#' (128) {
  215.     {    /* array: 2 elements */
  216.         /* [1] */
  217.         $"0000 0000 0000 0000 0000 0000 0000 0000"
  218.         $"0000 0000 07FF FF00 0600 0080 0500 0040"
  219.         $"0480 0020 0440 0010 0420 0008 0410 0004"
  220.         $"040F FFFE 0408 0002 0408 0002 0408 0002"
  221.         $"0408 0002 0408 0002 0408 0002 0408 0002"
  222.         $"0408 0002 0408 0002 0408 0002 0408 0002"
  223.         $"0208 0002 0108 0002 0088 0002 0048 0002"
  224.         $"0028 0002 0018 0002 000F FFFE",
  225.         /* [2] */
  226.         $"000F FFFC 001F FFF8 003F FFF0 007F FFE0"
  227.         $"00FF FFC0 0600 0080 05FF FF80 0792 49C0"
  228.         $"07C9 24E0 07E4 9270 07F2 4918 07FF FFFC"
  229.         $"07FF FFFE 07FF FFFE 07FF FFFE 07FF FFFE"
  230.         $"07FF FFFE 07FF FFFE 07FF FFFE 07FF FFFE"
  231.         $"07FF FFFE 07FF FFFE 07FF FFFE 07FF FFFE"
  232.         $"03FF FFFE 01FF FFFE 00FF FFFE 007F FFFE"
  233.         $"003F FFFE 001F FFFE 000F FFFE"
  234.     }
  235. };
  236.  
  237. resource 'BNDL' (128) {
  238.     'PSMP',
  239.     0,
  240.     {
  241.         'ICN#',
  242.         {
  243.             0, 128
  244.         },
  245.         'FREF',
  246.         {
  247.             0, 128
  248.         }
  249.     }
  250. };
  251.  
  252. resource 'FREF' (128) {
  253.     'APPL',
  254.     0,
  255.     ""
  256. };
  257.  
  258. resource 'SIZE' (-1) {
  259.     dontSaveScreen,
  260.     acceptSuspendResumeEvents,
  261.     enableOptionSwitch,
  262.     canBackground,
  263.     multiFinderAware,
  264.     backgroundAndForeground,
  265.     dontGetFrontClicks,
  266.     ignoreChildDiedEvents,
  267.     not32BitCompatible,
  268.     reserved,
  269.     reserved,
  270.     reserved,
  271.     reserved,
  272.     reserved,
  273.     reserved,
  274.     reserved,
  275.     kPrefSize * 1024,
  276.     kMinSize * 1024    
  277. };
  278.